﻿using System.Windows;

namespace Demos.Puzzles.EightPuzzle
{
    /// <summary>
    /// Lógica de interacción para View.xaml
    /// </summary>
    public partial class View : Window
    {
        public View()
        {
            InitializeComponent();
        }

        private void PuzzleSizeChanged(object sender, SizeChangedEventArgs e)
        {
            (DataContext as ViewModel).MaxX = Puzzle.ActualWidth;
            (DataContext as ViewModel).MaxY = Puzzle.ActualHeight;
            if ((DataContext as ViewModel).RedimensionarCommand.CanExecute(this))
            {
                (DataContext as ViewModel).RedimensionarCommand.Execute(this);
            }
        }
    }
}
